<template>
	<div class="equipmentDetail">
		<el-table :data="pageData.items" style="width: 100%">
			<el-table-column label="姓名" prop="name"></el-table-column>
			<el-table-column label="工号" prop="jobNumber"></el-table-column>
			<el-table-column label="平台认证" prop="state"></el-table-column>
			<el-table-column label="主团队及部门" prop="companyName"></el-table-column>
			<el-table-column label="职务" prop="dutiesName"></el-table-column>
			<el-table-column label="职级" prop="rankName"></el-table-column>
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-button type="text" size=" " class="isdelate" @click="deleteRow(scope.row)">移除成员</el-button>
				</template>
			</el-table-column>
		</el-table>
		<pagina-tion :totalNum="pageData.totalNum" @paginaClick="paginaClick"></pagina-tion>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				tableData: [],
				pageData: '',
				serviceTeamId: '',
				queryData:{
					serviceTeamId: '',
					page: 1,
					pageSize: $globalData.pageSize
				}
			}
		},
		mounted() {
			
		},
		methods:{
			getPageData(){
				// findServiceTeamIdQuery
				this.queryData.serviceTeamId = this.serviceTeamId
				this.$request.get(this.$api.findServiceTeamIdQuery, this.queryData).then(res=>{
					if(res.code == 200){
						this.pageData = res.data
					}
				})
			},
			paginaClick(val){
				this.queryData.page = val
				this.getPageData()
			},
			deleteRow(row) {
				// 删除
				// console.log(row)
				// return
				this.$confirm('确认删除该成员?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$request.get(this.$api.removeServiceTeamUser, {
						userId: row.id
					}).then(res => {
						if (res.code == 200) {
							this.$message.success('删除成功')
							if (this.queryData.page > 1) {
								this.queryData.page = Math.ceil((this.pageData.totalNum - 1) / $globalData.pageSize)
							}
							this.getPageData()
							this.$emit('callback')
						}
					})
				})
			}
		}
	}
</script>

<style scoped="scoped">
	.equipmentDetail>>>.demo-table-expand {
	    font-size: 0;
	  }
	  .equipmentDetail>>>.demo-table-expand label {
	    width: 90px;
		/* text-align: right; */
	    color: #A2A5A8;
		font-size: 12px;
		
	  }
	  .equipmentDetail>>>.demo-table-expand .el-form-item__content span {
	    /* width: 90px; */
	    color: #A2A5A8;
		font-size: 12px;
	  }
	  .equipmentDetail>>>.demo-table-expand .el-form-item {
	    margin-right: 0;
	    margin-bottom: 0;
	    width: 50%;
	  }
</style>
